#ifndef _SERVER_H
#define _SERVER_H

#include "TCPServer.h"
#include <iostream>
#include <boost/exception.hpp>
#include "UDPServer.h"
#include "Protocol.pb.h"

class Server:public EventListener
{
    public:
        Server(int Port);
        ~Server();
        void OnReceive(Session* session);
        void OnConnect(Session* session);
        void OnDisconnet(Session* session);
    protected:
    private:
        void ReceiveFromClient();
        void Process(std::string Message, int IDSocket);
        UDPServer* server;
        boost::mutex mMutex;
        Data* mData;
        //int ProtocolChange;
};

#endif // _SERVER_H
